home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue68 / Soap / Calculator / ITEC_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-03-03  |  5.1 KB  |  114 lines

  1. unit ITEC_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                    
  5. // -------                                                                    
  6. // The types declared in this file were generated from data read from a       
  7. // Type Library. If this type library is explicitly or indirectly (via        
  8. // another type library referring to this type library) re-imported, or the   
  9. // 'Refresh' command of the Type Library Editor activated while editing the   
  10. // Type Library, the contents of this file will be regenerated and all        
  11. // manual modifications will be lost.                                         
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.88.1.0.1.0  $
  15. // File generated on 03/03/2001 11:12:31 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: C:\Projects\2000\ITEC\SOAP\Calculator\Calc.tlb (1)
  19. // IID\LCID: {B41FE21C-7EF1-42C9-AB90-92BDBF03CD3E}\0
  20. // Helpfile: 
  21. // DepndLst: 
  22. //   (1) v2.0 stdole, (C:\WINNT\System32\Stdole2.tlb)
  23. //   (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
  24. // ************************************************************************ //
  25. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  26. interface
  27.  
  28. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
  29.  
  30. // *********************************************************************//
  31. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  32. //   Type Libraries     : LIBID_xxxx                                      
  33. //   CoClasses          : CLASS_xxxx                                      
  34. //   DISPInterfaces     : DIID_xxxx                                       
  35. //   Non-DISP interfaces: IID_xxxx                                        
  36. // *********************************************************************//
  37. const
  38.   // TypeLibrary Major and minor versions
  39.   ITECMajorVersion = 1;
  40.   ITECMinorVersion = 0;
  41.  
  42.   LIBID_ITEC: TGUID = '{B41FE21C-7EF1-42C9-AB90-92BDBF03CD3E}';
  43.  
  44.   IID_ICalc: TGUID = '{F1C4B3DB-6743-4DB6-BC0C-D073C19C7F47}';
  45.   CLASS_Calc: TGUID = '{55EC5DAF-5F02-422A-AFF4-FFCEF7CEDDD6}';
  46. type
  47.  
  48. // *********************************************************************//
  49. // Forward declaration of types defined in TypeLibrary                    
  50. // *********************************************************************//
  51.   ICalc = interface;
  52.   ICalcDisp = dispinterface;
  53.  
  54. // *********************************************************************//
  55. // Declaration of CoClasses defined in Type Library                       
  56. // (NOTE: Here we map each CoClass to its Default Interface)              
  57. // *********************************************************************//
  58.   Calc = ICalc;
  59.  
  60.  
  61. // *********************************************************************//
  62. // Interface: ICalc
  63. // Flags:     (4416) Dual OleAutomation Dispatchable
  64. // GUID:      {F1C4B3DB-6743-4DB6-BC0C-D073C19C7F47}
  65. // *********************************************************************//
  66.   ICalc = interface(IDispatch)
  67.     ['{F1C4B3DB-6743-4DB6-BC0C-D073C19C7F47}']
  68.     function  Add(A: Double; B: Double): Double; safecall;
  69.     function  Divide(A: Double; B: Double): Double; safecall;
  70.     function  Multiply(A: Double; B: Double): Double; safecall;
  71.     function  Subtract(A: Double; B: Double): Double; safecall;
  72.   end;
  73.  
  74. // *********************************************************************//
  75. // DispIntf:  ICalcDisp
  76. // Flags:     (4416) Dual OleAutomation Dispatchable
  77. // GUID:      {F1C4B3DB-6743-4DB6-BC0C-D073C19C7F47}
  78. // *********************************************************************//
  79.   ICalcDisp = dispinterface
  80.     ['{F1C4B3DB-6743-4DB6-BC0C-D073C19C7F47}']
  81.     function  Add(A: Double; B: Double): Double; dispid 1;
  82.     function  Divide(A: Double; B: Double): Double; dispid 4;
  83.     function  Multiply(A: Double; B: Double): Double; dispid 5;
  84.     function  Subtract(A: Double; B: Double): Double; dispid 6;
  85.   end;
  86.  
  87. // *********************************************************************//
  88. // The Class CoCalc provides a Create and CreateRemote method to          
  89. // create instances of the default interface ICalc exposed by              
  90. // the CoClass Calc. The functions are intended to be used by             
  91. // clients wishing to automate the CoClass objects exposed by the         
  92. // server of this typelibrary.                                            
  93. // *********************************************************************//
  94.   CoCalc = class
  95.     class function Create: ICalc;
  96.     class function CreateRemote(const MachineName: string): ICalc;
  97.   end;
  98.  
  99. implementation
  100.  
  101. uses ComObj;
  102.  
  103. class function CoCalc.Create: ICalc;
  104. begin
  105.   Result := CreateComObject(CLASS_Calc) as ICalc;
  106. end;
  107.  
  108. class function CoCalc.CreateRemote(const MachineName: string): ICalc;
  109. begin
  110.   Result := CreateRemoteComObject(MachineName, CLASS_Calc) as ICalc;
  111. end;
  112.  
  113. end.
  114.